Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: assorted completion-related issues #226

Merged
merged 1 commit into from
Oct 24, 2024
Merged

fix: assorted completion-related issues #226

merged 1 commit into from
Oct 24, 2024

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Oct 24, 2024

  • Unquote the token-to-be-completed passed into compgen
  • Support multiple-options-in-one-token in getopts (e.g., -abc as shorthand for -a -b -c)
  • Initialize OPTIND, OPTERR in each newly constructed shell.
  • Fix bug in printf hack for %q and ~%q.
  • Don't filter out file/dir completions whose prefixes don't match the token-being-completed (e.g., for ~ et al.).
  • For file/dir completions, basic-expand the token-to-be-completed (we formerly did this higher up the stack).
  • Express compatibility with a slightly newer version of bash (5.2.x).
  • Re-enable some previously disabled tests.

Copy link

github-actions bot commented Oct 24, 2024

Test Results

  2 files    9 suites   1m 5s ⏱️
493 tests 493 ✅ 0 💤 0 ❌
975 runs  975 ✅ 0 💤 0 ❌

Results for commit a1a1c6a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Oct 24, 2024

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
expand_one_string 3.42 μs 3.42 μs 0.00 μs ⚪ Unchanged
instantiate_shell 60.55 μs 59.71 μs -0.84 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 30366.85 μs 30618.42 μs 251.57 μs 🟠 +0.83%
parse_bash_completion 2768.72 μs 2801.54 μs 32.83 μs 🟠 +1.19%
parse_sample_script 4.26 μs 4.25 μs -0.00 μs ⚪ Unchanged
run_echo_builtin_command 90.33 μs 89.64 μs -0.69 μs ⚪ Unchanged
run_one_builtin_command 107.92 μs 109.23 μs 1.31 μs ⚪ Unchanged
run_one_external_command 1982.78 μs 1980.10 μs -2.69 μs ⚪ Unchanged
run_one_external_command_directly 1011.24 μs 1006.63 μs -4.62 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/complete.rs 🔴 22.11% 🔴 21.57% 🔴 -0.54%
brush-core/src/builtins/getopts.rs 🟢 95.9% 🟢 94.81% 🔴 -1.09%
brush-core/src/builtins/printf.rs 🟢 92% 🟢 93.88% 🟢 1.88%
brush-core/src/completion.rs 🔴 18.63% 🔴 19.93% 🟢 1.3%
brush-core/src/shell.rs 🟢 78.11% 🟢 78.52% 🟢 0.41%
brush-shell/src/main.rs 🟢 90.2% 🟢 90.85% 🟢 0.65%
Overall Coverage 🟢 73.53% 🟢 73.55% 🟢 0.02%

Minimum allowed coverage is 70%, this run produced 73.55%

@reubeno reubeno marked this pull request as ready for review October 24, 2024 16:49
@reubeno reubeno merged commit 095a4be into main Oct 24, 2024
11 checks passed
@reubeno reubeno deleted the completion-fixes branch October 24, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant